<template>
    <div id="activity">
        <navbar :title="title" ></navbar>
        <h3 v-html="activitytit"></h3>
        <div class="container" v-html="content"></div>
    </div>
</template>

<script>
    import navbar from 'common/navbar'
    import {getActivityDetail} from "api/game_box"
    export default {
        data(){
            return{
                title:'活动详情',
                content:'',
                activitytit:''
            }
        },
        created(){
            let id=this.$route.params.cid;
            getActivityDetail(id).then(res=>{
                if(res.data.error==0){
                    res=res.data.content
                    this.content=res.content;
                    this.activitytit=res.title;
                }
            })
        },
        components:{
            navbar
        },
        mounted(){
            document.getElementsByClassName("gameDetail-con")[0].style="height:0";
        },
        beforeDestroy: function() {
            try{
                document.getElementsByClassName("gameDetail-con")[0].style="height:auto";
            }catch(err){

            }
        }
    }
</script>

<style scoped lang="scss">
@import '~styles/variable.scss';
#activity{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    right:0;
    overflow:scroll;
    background:#fff;
    z-index:999;
    h3{
        padding:1rem 0.2rem 0 0.2rem;
        line-height:0.6rem;
        font-size:$font-size-l;
        text-align:center;
        font-weight:bold;
    }
    .container{
        width: 7.5rem;
        margin:0 auto;
        padding:0 0.2rem 0.4rem 0.2rem;
        margin-top:0.2rem;
    }
}
</style>